<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="cn.firstsoft.firstframe.admin.PropertyFile"%>
<%@ page import="org.springside.core.Constants" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>管理控制台 - 系统工具 - 控制台用户密码</title>
<%@ include file="/common/meta2.jsp"%>
<link href="../style.css" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<script type="text/javascript" language="javascript">
	function checkUser() {
		if (document.userForm.username.value == '') {
			alert("用户名不能为空！");
			return false;
		}
		if (document.userForm.oldpassword.value == '') {
			alert("原密码不能为空！");
			return false;
		}		
		if (document.userForm.password.value == '') {
			alert("密码不能为空！");
			return false;
		}
		if (document.userForm.password.value != document.userForm.password1.value) {
			alert("两次输入的密码不相同！");
			return false;
		}
		return true;
	}	
</script>
<%
String username = PropertyFile.readValue("user.properties","username");
if (username == null) username = "admin";
%>

<FORM method="post" name="userForm" action="user_set.jsp" onsubmit="return checkUser();">
	<table width="100%" align="center" >
		<TR>
			  <TH class=listViewPaginationTdS1  align=left colSpan=4>
			   控制台用户名和密码设置</TH></TR>
		<TR>
		<tr>
			<td class=dataLabel width="30%" align="right">控制台用户：</td>
			<td width="2%"></td>
			<td class=dataField><INPUT type="text" name="username" value="<%=username%>" /></td>
			<td align="left">只能是英文字母或者数字，区分大小写！</td>
		</tr>
		<tr>
			<td class=dataLabel width="30%" align="right">控制台原密码：</td>
			<td width="2%"></td>
			<td class=dataField><INPUT type="password" name="oldpassword" value="" maxlength="20"/></td>
			<td align="left">只能是英文字母或者数字，区分大小写！</td>
		</tr>
		<tr>
			<td class=dataLabel width="30%" align="right">控制台新密码：</td>
			<td width="2%"></td>
			<td class=dataField><INPUT type="password" name="password" value="" maxlength="20"/></td>
			<td align="left">只能是英文字母或者数字，区分大小写！</td>
		</tr>
		<tr>
			<td class=dataLabel width="30%" align="right">重输入新密码：</td>
			<td width="2%"></td>
			<td class=dataField><INPUT type="password" name="password1" value="" /></td>
			<td align="left">校验新密码的正确性，重新输入一遍新密码</td>
		</tr>	
		<tr>
			<td></td>
			<td></td>
			<td>
				<input class=button type=submit value="&nbsp;提&nbsp;&nbsp;交&nbsp;" />
				<input class=button type=reset value="&nbsp;重&nbsp;&nbsp;置&nbsp;" />
			</td>
			<td></td>
		</tr>				
	</table>
</FORM>
</body>
</html>
